﻿using Com.OpenCode.Framework.Core;
using Com.OpenCode.Framework.DevForm;

namespace Com.OpenCode.Framework.Workbench
{
    public class StatusBarDoozer : IDoozer
    {
        public object BuildItem(BuildItemEventArgs args)
        {
            string _TypeName = args.Plugin.Properties.Get("Type").ToString();
            IStatusSetValue _StatusSetValue = null;
            switch (_TypeName)
            {
                case "Bar":
                    _StatusSetValue = new StatusBarUI(args);
                    foreach (Plugin child in args.Plugin.Children)
                    {
                        args.Plugin.Addin.Bulid(child, _StatusSetValue);
                    }
                    break;
                case "Label":
                    _StatusSetValue = new StatusLabelUI(args);
                    break;
                case "Progress":
                    _StatusSetValue = new StatusProgressUI(args);
                    break;
                case "Button":
                    _StatusSetValue = new StatusButtonUI(args);
                    break;
                case "DateTime":
                    _StatusSetValue = new StatusDateEditUI(args);
                    break;
            }
            return _StatusSetValue;
        }

        public string Name
        {
            get { return "StatusBar"; }
        }
    }
}